﻿<?
@session_start();
	@require_once("services/Utility.php");
	
		if(!isset($_SESSION["canAccess"]) || $_SESSION["canAccess"] != 'true')
		{
			echo '<script type="text/javascript"> window.location="index.php"; </script>';
		}

	@require_once("services/profileInfoLoader.php");
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US" xml:lang="en">
<head>
<title>Profile</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<link rel="stylesheet" href="style/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="style/info.css" type="text/css" media="screen" />
<link rel="stylesheet" href="style/icons.css" type="text/css" media="screen" />

<link rel="stylesheet" href="style/autosuggest.css" type="text/css" media="screen" />
<script type="text/javascript" src="script/suggest.js"></script>

<script type="text/javascript" src="script/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="script/editData.js"></script>
<!-- Dialog -->
<link rel="stylesheet" href="style/messi.min.css" />
<script src="script/messi.js"></script>

<link type="text/css" href="css/cupertino/jquery-ui-1.8.21.custom.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-ui-1.8.21.custom.min.js"></script>

	
</head>
<body>
<div id="art-page-background-simple-gradient">
    </div>
    <div id="art-page-background-glare">
        <div id="art-page-background-glare-image"></div>
    </div>
    <div id="art-main">
        <div class="art-Sheet">
            <div class="art-Sheet-tl"></div>
            <div class="art-Sheet-tr"></div>
            <div class="art-Sheet-bl"></div>
            <div class="art-Sheet-br"></div>
            <div class="art-Sheet-tc"></div>
            <div class="art-Sheet-bc"></div>
            <div class="art-Sheet-cl"></div>
            <div class="art-Sheet-cr"></div>
            <div class="art-Sheet-cc"></div>
            <div class="art-Sheet-body">
                <div class="art-Header">
                    <div class="art-Header-jpeg"></div>
                </div>
                <div class="art-contentLayout" style="height: 400px !important;">
                    <div class="art-content">
                        <div class="art-Post">
						
						<!-- Begin Content -->
						
						<div>
<? @require_once("component/Menu.php"); ?>
</div>
<?		
	$profileId = $_GET['profileId'];
	
	$_SESSION['random_key'] = $profileId;
?>

<div class="profileLeft">
	<span id="profileId" style="display:none"><? echo $profileId ?></span>
	<div>
		<img src="profileImage/FullFrame/<? if($detail && $detail['profilePic'] != '') echo $detail['profilePic']; else echo "Unknown.png"; ?>" id="photo_1">
	</div>
	
	<div>
					<table>
						<tr <? if(!IsMyself()) echo " style='display:none;'"; ?>>
							<td <? if(!IsMyself()) echo 'class="disable"'; ?>>
								<a href="<? if(IsMyself()) echo "uploadPic.php?profileId=" . $profileId; else echo "javascript:void(0);" ?>" rel="nofollow" onclick="" title="">
									<div class="icon front icon-picture"></div>
									เปลี่ยนภาพ
								</a>
							</td>
						</tr>
						<tr <? if(!IsMyself()) echo " style='display:none;'"; ?>>
							<td onclick="<? if(IsMyself()) echo "EditInfo();"; else echo "javascript:void(0);" ?>" <? if(!IsMyself()) echo 'class="disable"'; ?>>
								<a href="javascript:void(0);" rel="nofollow" title="">
									<div class="icon front icon-edit-text"></div>
									แก้ไขประวัติ
								</a>
							</td>
						</tr>
						<tr>
							<td class="disable">
								<a href="javascript:void(0);" rel="nofollow" onclick="" title="">
									<div class="icon front icon-lock"></div>
									change password
								</a>
							</td>
						</tr>
					</table>
				</div>
</div>

<div class="profileRight">
<table class="profile" id="allProfile">
	<tr class="headerInfo">
		<td colspan="2">
			<h3 class="font-color-meta">Info :</h3>
		</td>
	</tr>
					<tr>
						<td>ชื่อ:</td>
						<td><span id="Name"><? if($detail) echo $detail['name'] . " " . $detail['lastname']; else echo "-"; ?></span></td>
					</tr>
					<tr>
						<td>ชื่อเล่น:</td>
						<td><span id="NickName"><? if($detail && $detail['nickName'] != '') echo $detail['nickName']; else echo "-"; ?></span></td>
					</tr>
					<!--tr>
						<td>สถานะ:</td>
						<td>
								<span id="UserStatus"><? if($detail && $detail['status'] != '') echo $detail['status']; else echo "-"; ?></span>
						</td>
					</tr-->
					<tr>
						<td>วันเกิด:</td>
						<td><span id="Birthday"><? if($detail && $detail['birthday'] != '') echo $detail['birthday']; else echo "-"; ?></span></td>
					</tr>
					<tr>
						<td>อาชีพ:</td>
						<td><span id="Job"><? if($detail && $detail['job'] != '') echo $detail['job']; else echo "-"; ?></span></td>
					</tr>
					<tr>
						<td>สถานที่ทำงาน:</td>
						<td>
							<!--a href="/profile?Workplace=Thomsonreuters"-->
							<span id="WorkPlace"><? if($detail && $detail['workplace'] != '') echo $detail['workplace']; else echo "-"; ?></span>
							<!--/a-->
						</td>
					</tr>
					<!--tr>
						<td>พี่เลี้ยง:</td>
						<td>
							<?  echo '<span id="Discipler">';
								if($disciplerDetail && $disciplerDetail['profileId'] != '')
									echo '<a href="/profileInfo.php?profileId=' . $disciplerDetail['profileId'] . '">';
							
								if($disciplerDetail) echo $disciplerDetail['name'] . " " . $disciplerDetail['lastname']; else echo "-";
								
								if($disciplerDetail && $disciplerDetail['profileId'] != '')
									echo '</a>';
								echo '</span>';
							?>
						</td>
					</tr-->
					<tr>
						<td>กลุ่ม:</td>
						<td>
							<!--a href="/profile?Group=Alumni"-->
								<span id="Group"><? if($detail && $detail['Typedisplay'] != '') echo $detail['Typedisplay']; else echo "-"; ?></span>
							<!--/a-->
						</td>
					</tr>
					<!--tr>
						<td>คริสตจักร:</td>
						<td>
								<span id="Church"><? if($detail && $detail['church'] != '') echo $detail['church']; else echo "-"; ?></span>
						</td>
					</tr-->
					<!--tr>
						<td>กลุ่ม cell:</td>
						<td>
								<span id="CellGroup"><? if($detail && $detail['cellGroup'] != '') echo $detail['cellGroup']; else echo "-"; ?>
						</td>
					</tr-->
					<? if(CanSeeAllInfo()) { ?>
					<!--tr>
						<td>Rank:</td>
						<td>
							<span id="ProfileRank"><?
								$rank = GetRank();
								if($rank != 'Unknown') echo '<div class="icon front rank' . $rank . '"></div>';
								echo $rank;
							?></span>
						</td>
					</tr-->
					<? } ?>
					
					<tr class="headerInfo">
						<td colspan="2">
							<h3 class="font-color-meta">Other details</h3>
						</td>
					</tr>
					<tr>
						<td>เบอร์โทร:</td>
						<td><span id="phone"><? if($detail && $detail['phone'] != '') echo $detail['phone']; else echo "-"; ?></span></td>
					</tr>
					<tr>
						<td>Email:</td>
						<td>
							<span id="email"><?
								if($detail && $detail['mail'] != '')
								{
									echo '<div class="icon front icon-mail"></div>';
									echo '<a href="mailto:' . $detail['mail'] . '">' . $detail['mail'] . '</a>';
								}
								else echo "-";
							?></span>
						</td>
					</tr>
					<tr>
						<td>Facebook:</td>
						<td>
							<span id="facebook"><?
								if($detail && $detail['facebook'] != '')
								{
									echo '<a href="' . $detail['facebook'] . '">Facebook</a>';
								}
								else echo "-";
							?></span>
						</td>
					</tr>
					<tr>
						<td>ที่อยู่:</td>
						<td>
							<span id="address"><? if($detail && $detail['address'] != '') echo $detail['address']; else echo "-"; ?></span>
						</td>
					</tr>
					<tr>
						<td>จังหวัด:</td>
						<td>
							<!--a href="/profile?City=Nontaburi"-->
							<span id="province"><? if($detail && $detail['province'] != '') echo $detail['province']; else echo "-"; ?></span>
							<!--/a-->
						</td>
					</tr>
					<tr>
						<td>รหัสไปรษณีย์:</td>
						<td><span id="postcode"><? if($detail && $detail['postcode'] != '') echo $detail['postcode']; else echo "-"; ?></span></td>
					</tr>
					<tr>
						<td>มหาวิทยาลัย:</td>
						<td>
							<!--a href="/profile?University=TU">ธรรมศาสตร์</a>,
							<a href="/profile?University=Chula">จุฬา</a-->
							<span id="university"><? if($detail && $detail['university'] != '') echo $detail['university']; else echo "-"; ?></span>
						</td>
					</tr>
					<!--tr>
						<td>เขต:</td>
						<td>
							<span id="zone"><? if($detail && $detail['zone'] != '') echo $detail['zone']; else echo "-"; ?></span>
						</td>
					</tr-->
					<? if(false && CanSeeAllInfo()) { ?>
					<tr>
						<td>คอมเม้นต์:</td>
						<td>No Any Comment</td>
					</tr>
					<tr>
						<td>คอมเม้นต์โดย:</td>
						<td>
							<a href="/profile?Name=Montree%20Kaewmongkolsuk">
								มนตรี แก้วมงคฃสุข
							</a>
						</td>
					</tr>
					<? } ?>

					<!--tr class="j-profile-extended-data">
						<td>Last Update:</td>
						<td><? if($detail && $detail['updateDate'] != '') echo $detail['updateDate']; else echo "-"; ?></td>
					</tr-->
					<? if(false && $canAccess && $accessType='fullAccess') { ?>
					<tr class="headerInfo">
						<td colspan="2">
							<h3 class="font-color-meta">Disciples</h3>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div class="icon tab rankB margin-left"></div>
							<a href="/profile?Name=Montree%20Kaewmongkolsuk">
								Montree Kaewmongkolsuk
							</a>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div class="icon tab rankA margin-left"></div>
							<a href="/profile?Name=Sae%20Smith">
								Sae Smith
							</a>
						</td>
					</tr>
					<? } ?>
		<tr>
			<td colspan="2">
				<div id="Extension" style="padding-left: 80px;">
					&nbsp;
				</div>
			<td>
		</tr>
</table>
</div>

<div class="suggestionsBox" id="suggestions" style="display: none;">
	<div class="suggestionList" id="suggestionsList"> &nbsp; </div>
</div>
						
						<!-- End of Content -->
						
                        </div>
                    </div>
                </div>
        		<div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>
    </div>
    
</body>
</html>